﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Clothes.BLL;
using Clothes.IBLL;

namespace Clothes.UI
{
    public partial class Register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Page.IsValid) {
                CLLoginIBLL cLLogin = new CLLoginBLL();
                
                Comment.OperResult a = cLLogin.Register(UserName.Text, MobileNumber.Text, Password.Text, Convert.ToInt32(DropDownList1.SelectedValue));
                if (a.Status == true)
                {
                    Response.Redirect("Personal.aspx");
                }
                else {
                    ClientScript.RegisterStartupScript(GetType(), "loginerror", $"alert('{a.Massage}')", true);
                }
            }
            
        }
    }
}